/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ssau.datamanager;

import java.rmi.RemoteException;
import javax.ejb.EJBObject;
import java.util.Date;
import ru.ssau.entities.DataAccessException;


public interface DataManager extends EJBObject {
    void addThread(String caption) throws RemoteException, DataAccessException;
    void replaceThread(Integer id, String caption) throws RemoteException, DataAccessException;
    String getThreadXMLById(Integer id) throws RemoteException, DataAccessException;
    void deleteThreadById(Integer id) throws RemoteException, DataAccessException;
    String getThreadsXML() throws RemoteException;
    String findThreadsXMLByCaption(String caption) throws RemoteException, DataAccessException;

    void addMessage(String caption, String text, Integer userId, Integer threadId, Date postDate) throws RemoteException, DataAccessException;
    void replaceMessage(Integer id, String caption, String text, Integer userId, Integer threadId, Date postDate) throws RemoteException, DataAccessException;
    String getMessageXMLById(Integer id) throws RemoteException, DataAccessException;
    void deleteMessageById(Integer id) throws RemoteException, DataAccessException;
    String getMessagesXML() throws RemoteException, DataAccessException;
    String findMessagesXMLByCaption(String caption) throws RemoteException, DataAccessException;

    void addUser(String name, Date regDate, String info, String login, String password) throws RemoteException, DataAccessException;
    void replaceUser(Integer id, String name, Date regDate, String info, String login, String password) throws RemoteException, DataAccessException;
    String getUserXMLById(Integer id) throws RemoteException, DataAccessException;
    void deleteUserById(Integer id) throws RemoteException, DataAccessException;
    String getUsersXML() throws RemoteException, DataAccessException;
    String findUsersXMLByName(String name) throws RemoteException, DataAccessException;

}
